<?php 
	$title = 'title_'.$this->lang;
	$content = 'content_'.$this->lang;
	$highlight = 'highlight_'.$this->lang;
?>
<div id="left-180">
	<div class="box-h1" id="home-topevents">
		<h1 title="Top events"><?=Kohana::lang('title.topevents')?></h1>
		<div class="box">
			<ul>
			<?php foreach($topevents as $event) { ?>
				<li>
					<h2><?=html::anchor('calender/index/'.date('n', strtotime($event->start_date)).'/'.date('Y', strtotime($event->start_date)), $event->$title)?></h2>
					<p>
						<?=Kohana::lang('site.startdate')?>：<?=$event->start_date?><br/>
						<?=Kohana::lang('site.enddate')?>：<?=$event->end_date?>
					</p>
				</li>
			<?php } ?>
			</ul>
		</div>
	</div>
	<?php include(Kohana::find_file('views', 'common/forum')); ?>
</div>
<div id="left-580">
	<div class="box-h1" id="home-whatsnew">
		<h1 title="Home What's New"><?=Kohana::lang('title.whatsnew')?></h1>
		<div class="box bgFFF">
			<ul>
			<?php foreach($whatsnew as $item) { ?>
				<li>
					<h2><?=$item->$title?></h2>
					<div class="desc">
						<span><?=html::image('photo/article/200/'.$item->id.'.'.$item->photo_ext)?></span>
						<p><?=nl2br($item->$highlight)?></p>
						<?=html::anchor($item->url_link, Kohana::lang('site.readmore'), array('class'=>"more"))?>
						<p style="clear:both;"/>
					</div>
				</li>
			<?php } ?>
			</ul>
			<div style="clear:both;"></div>
		</div>
	</div>
</div>
<div id="right-180">
	<div class="box-h1" id="home-newbooks">
		<h1 title="Home New Books"><?=Kohana::lang('title.newbooks')?></h1>
		<div class="box">
			<ul class="bh-book-list">
			<?php foreach($new_products as $product) { ?>
				<li>
					<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?><br/>
					<p><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?>
					<br/>$<?=$product->price?></p>
				</li>
			<?php } ?>
			</ul>
			<div style="clear:both;"><p style="float:right"><?=html::anchor('bookstore', Kohana::lang('site.more').'...')?></p></div>
		</div>
	</div>
	<div class="box-h1" id="home-bestsellers">
		<h1 title="Home Best Sellers"><?=Kohana::lang('title.bestsellers')?></h1>
		<div class="box">
			<ul class="bh-book-list">
			<?php foreach($best_products as $product) { ?>
				<li>
					<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?><br/>
					<p><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?>
					<br/>$<?=$product->price?></p>
				</li>
			<?php } ?>
			</ul>
			<div style="clear:both;"><p style="float:right"><?=html::anchor('bookstore', Kohana::lang('site.more').'...')?></p></div>
		</div>
	</div>
</div>